Skip to content

Fix/pglite socket ssl request#990

Merged
tdrz merged 5 commits into
electric-sql:mainfrom
OneCalmCloud:fix/pglite-socket-ssl-request
Jun 15, 2026
Merged

Fix/pglite socket ssl request#990
tdrz merged 5 commits into
electric-sql:mainfrom
OneCalmCloud:fix/pglite-socket-ssl-request

Conversation

@OneCalmCloud

Copy link
Copy Markdown
Contributor

#989
Handle the SSLRequest startup packet per the PostgreSQL wire protocol: when SSL is not available, respond with N so the client may continue with a cleartext StartupMessage. Improves interoperability with JDBC clients such as DBeaver that probe TLS first without requiring manual SSL mode tweaks. See https://www.postgresql.org/docs/current/protocol-message-formats.html .

Comment thread packages/pglite-socket/src/index.ts Outdated
Comment thread packages/pglite-socket/tests/ssl-request.test.ts Outdated
@OneCalmCloud OneCalmCloud requested a review from tdrz June 14, 2026 14:04

@tdrz tdrz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@tdrz tdrz merged commit 7f6ee05 into electric-sql:main Jun 15, 2026
14 checks passed
bookernath pushed a commit to bookernath/pglite that referenced this pull request Jun 21, 2026
Rebased onto main, which now handles SSLRequest (replies 'N') via the
extracted handleSslRequest() method (electric-sql#990).

Adapts the remaining CancelRequest handling to that same style as requested
in review: adds named CANCEL_REQUEST_CODE / CANCEL_REQUEST_LENGTH constants
(no magic numbers) and extracts the logic into a dedicated handleCancelRequest()
method called from the handleData() loop alongside handleSslRequest().

PGlite has no backend process to signal, so the request is consumed and
silently ignored (the protocol expects no response). Drops the now-redundant
inline SSL handling and SSL-specific tests (covered by upstream's
ssl-request.test.ts); keeps a CancelRequest integration test.
@OneCalmCloud OneCalmCloud deleted the fix/pglite-socket-ssl-request branch June 24, 2026 02:46
bookernath pushed a commit to bookernath/pglite that referenced this pull request Jun 25, 2026
Rebased onto main, which now handles SSLRequest (replies 'N') via the
extracted handleSslRequest() method (electric-sql#990).

Adapts the remaining CancelRequest handling to that same style as requested
in review: adds named CANCEL_REQUEST_CODE / CANCEL_REQUEST_LENGTH constants
(no magic numbers) and extracts the logic into a dedicated handleCancelRequest()
method called from the handleData() loop alongside handleSslRequest().

PGlite has no backend process to signal, so the request is consumed and
silently ignored (the protocol expects no response). Drops the now-redundant
inline SSL handling and SSL-specific tests (covered by upstream's
ssl-request.test.ts); keeps a CancelRequest integration test.
tdrz pushed a commit that referenced this pull request Jun 25, 2026
Rebased onto main, which now handles SSLRequest (replies 'N') via the
extracted handleSslRequest() method (#990).

Adapts the remaining CancelRequest handling to that same style as requested
in review: adds named CANCEL_REQUEST_CODE / CANCEL_REQUEST_LENGTH constants
(no magic numbers) and extracts the logic into a dedicated handleCancelRequest()
method called from the handleData() loop alongside handleSslRequest().

PGlite has no backend process to signal, so the request is consumed and
silently ignored (the protocol expects no response). Drops the now-redundant
inline SSL handling and SSL-specific tests (covered by upstream's
ssl-request.test.ts); keeps a CancelRequest integration test.

Co-authored-by: bookernath <nathan.booker@bigcommerce.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants